#ifndef __KYO_SDL_NET_H__
#define __KYO_SDL_NET_H__

#include <sdl.h>

struct sdl_udp_t {
    UDPsocket socket;
    UDPpacket *packet;
};

struct sdl_udp_t *sdl_udp_open(const char *ip, unsigned short port, unsigned long buf_size);
void sdl_udp_setconnect(struct sdl_udp_t *, IPaddress *ip);
void *sdl_udp_recv(struct sdl_udp_t *, int *result);
int prepare_data(struct sdl_udp_t *, void *data, int size);
int sdl_udp_send_ip(struct sdl_udp_t *, IPaddress *ip, void *data, int size);
int sdl_udp_send(struct sdl_udp_t *, void *data, int size);
void sdl_udp_close(struct sdl_udp_t *);


#endif /* __KYO_SDL_NET_H__ */
